package com.ogawa.jopai.devicemanage.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.ogawa.base.utils.imageloader.ImageConfigImpl
import com.ogawa.base.utils.imageloader.ImageLoader
import com.ogawa.jopai.devicemanage.bean.GetDeviceShareResponse
import com.ogawa.joypal.devicemanage.R

class MessageListAdapter:
    BaseQuickAdapter<GetDeviceShareResponse, BaseViewHolder>(
        R.layout.item_message,
        ArrayList<GetDeviceShareResponse>()
    ) {
    override fun convert(helper: BaseViewHolder, item: GetDeviceShareResponse) {
        helper.addOnClickListener(R.id.acceptIv, R.id.refuseIv)
        helper.setText(R.id.titleTv, "${item.fromUserName}${mContext.getString(R.string.share_chair_info)}")
        helper.setText(R.id.contentTv, "${item.typeName}")
        ImageLoader.getInstance().loadImage(mContext, ImageConfigImpl
            .builder()
            .isCenterCrop(true)
            .url(item.imgUrl)
            .placeholder(R.drawable.img_chair)
            .imageView(helper.getView(R.id.itemMessageChairIv))
            .build())
    }
}